<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link href="/res/third/bootstrap3/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <script src="/res/common/js/jquery.1.9.1.min.js" type="text/javascript"></script>
    <script src="/res/third/artDialog/jquery.artDialog.js" type="text/javascript"></script>
    <script src="/res/third/validate/jquery.validate.js" type="text/javascript"></script>
    <script src="/res/third/laytpl/template.js"></script>
    <script src="/res/common/js/jquery.form.js"></script>
    <script src="/res/third/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="/res/third/easyUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script type="text/javascript">
        function sosuo(){
            var lpath =location.pathname;
            var pageNo = 1;
            $("#soform").attr("action",lpath+"?pageNo="+pageNo);
            $("#soform").submit();
        }
        function deleteRow(id){
            art.dialog.confirm("确认删除此条记录？",function(){
                art.dialog.post({
                    url:"/entrust/notes/delete.do", data:{ id: id }, success:function(data){
                        if(data.success){
                            refresh();
                        }
                    }

                })
            },function(){

            })
        }
    </script>
    <script type="text/html" id="change_template">
        <form id="edit_form" style="width: 400px;" action="/entrust/notes/save.do" method="post" class="form-horizontal" role="form">
            <input type="hidden" name="companyId" value="{{companyId}}">
            <div class="form-group">
                <label  class="col-sm-4 control-label">企业名称</label>
                <div class="col-sm-8">
                    <label>{{companyName}}</label>
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-4 control-label">成长值类型</label>
                <div class="col-sm-8">
                    <select class="form-control" name="levelType">
                        <option value="2">供应商成长值</option>
                        <option value="1">采购商成长值</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-4 control-label">成长值变化</label>
                <div class="col-sm-8">
                    <input type="radio" name="type" value="1" checked="checked">增加
                    <input type="radio" name="type" value="-1">减少
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-4 control-label">数值</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" placeholder="请输入数值" name="changeValue" value="{{changeValue}}">
                </div>
            </div>
            <div class="form-group">
                <label  class="col-sm-4 control-label">原因</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" placeholder="不超过 20 个字" maxlength="20" name="changeReason" value="{{changeReason}}">
                </div>
            </div>
        </form>
    </script>
</head>
<body>
<div class="panel panel-info panel-content">
    <div class="panel-heading">
        <div class="row">
            <div class="col-md-9">
                <form class="form-inline" method="post">
                    <div class="form-group">
                        <label for="so_companyName">企业名称</label>
                        <input type="text" class="form-control" id="so_companyName" name="so_companyName" value="${so_companyName!}" placeholder="企业名称">
                    </div>
                    <button type="submit" class="btn btn-default btn-primary" onclick="sosuo();">搜索</button>
                </form>
            </div>
            <div class="col-md-3">
                <a style="float: right" href="/entrust/notes/edit.do" class="btn btn-info"> <span class="glyphicon glyphicon-plus"></span> &nbsp;新增委托</a>
            </div>
        </div>
    </div>
    <table class="table table-hover table-bordered table-striped table-condensed">
        <tr>
            <th>#</th>
            <th>委托类型</th>
            <th>企业名称</th>
            <th>采购金额</th>
            <th>联系人</th>
            <th>电话</th>
            <th>更新时间</th>
            <th>操作</th>
        </tr>
        [#list pagination.list as item]
        <tr>
            <td align="center">${pagination.pageSize * (pagination.pageNo-1)+item_index+1}</td>
            <td align="center">[#if (item.applyType!1) == 1]委托设计[#else]委托采购[/#if]</td>
            <td align="center">${item.companyName!}</td>
            <td align="center">${item.amount!}</td>
            <td align="center">${item.contactName!}</td>
            <td align="center">${item.contactTel!}</td>
            <td align="center">${item.updatetime?string("yyyy-MM-dd HH:mm:ss")!}</td>
            <td align="center">
                <a href="/entrust/notes/edit.do?id=${item.id!}"  class="btn btn-info btn-xs">编辑</a>
                <button class="btn btn-danger btn-xs" onclick="deleteRow('${item.id!}');">删除</button>
            </td>
        </tr>
        [/#list]
    </table>
    <div class="panel-footer">[@fenye p = pagination form = 'infoForm' /]</div>
</div>
</body>
</html>
